package com.keller.service.impl;

import com.github.pagehelper.PageHelper;
import com.keller.dao.OrdersDao;
import com.keller.domian.Orders;
import com.keller.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrdersServiceImpl implements OrdersService {
    @Autowired
    private OrdersDao ordersDao;
    @Override
    public List<Orders> findAll(Integer page, Integer pageSize) throws Exception {
        PageHelper.startPage(page, pageSize);
        List<Orders> orders = ordersDao.findAll();
        return orders;
    }

    @Override
    public Orders findOrderById(String id) throws Exception {
        return ordersDao.findOrderById(id);
    }
}
